﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudStorageLight.Core.Web
{
    public class AccessLogItem
    {
        public DateTimeOffset AccessDate { get; set; }
        public string Path { get; set; }
        public string UserName { get; set; }
        public string Action { get; set; }
        public string ActionName 
        {
            get
            {
                if (Action == BlobService.LogList) return Messages.LogList;
                if (Action == BlobService.LogGet) return Messages.LogGet;
                if (Action == BlobService.LogDownload) return Messages.LogDownload;
                if (Action == BlobService.LogUpload) return Messages.LogUpload;
                if (Action == BlobService.LogSearch) return Messages.LogSearch;
                if (Action == BlobService.LogRename) return Messages.LogRename;
                if (Action == BlobService.LogCheckOut) return Messages.LogCheckOut;
                if (Action == BlobService.LogDelete) return Messages.LogDelete;
                if (Action == BlobService.LogRecover) return Messages.LogRecover;
                if (Action == BlobService.LogMove) return Messages.LogMove;
                if (Action == BlobService.LogCreate) return Messages.LogCreate;
                if (Action == BlobService.LogUpdate) return Messages.LogUpdate;
                if (Action == BlobService.LogCheckIn) return Messages.LogCheckIn;
                if (Action == BlobService.LogDebug) return Messages.LogDebug;
                if (Action == BlobService.LogSearchById) return Messages.LogSearchById;
                if (Action == BlobService.LogCreateFolder) return Messages.LogCreateFolder;
                if (Action == BlobService.LogDeleteFolder) return Messages.LogDeleteFolder;
                if (Action == BlobService.LogUpdateFullText) return Messages.LogUpdateFullText;
                if (Action == BlobService.LogSet) return Messages.LogSet;
                if (Action == BlobService.LogCrawl) return Messages.LogCrawl;
                if (Action == BlobService.LogRecommended) return Messages.LogRecommended;

                return Action;
            }
            set
            {
                throw new NotSupportedException();
            }
        }
    }
}
